﻿Imports System.Data.SqlClient
Public Class frmNominasCalculo

    Private Sub ToolStripButton4_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripButton4.Click
        Close()

    End Sub

    Private Sub ToolStripButton1_Click(sender As System.Object, e As System.EventArgs) Handles ToolStripButton1.Click
        Dim IdTipoPeriodo As Integer = BuscarIntDatoNominas("NOM10023", "IdTipoPeriodo", "NombreTipoPeriodo='" & lstPeriodos.Text & "'")
        Call SetSqlNominas("UPDATE NOM10001 SET Calculado=1 Where IdTipoPeriodo=" & IdTipoPeriodo)
        Close()
    End Sub
    Sub Periodos()

        lstPeriodos.Items.Clear()

        Dim cnConn As New SqlConnection
        cnConn.ConnectionString = NominasConnection

        Dim strSql As String = ""
        strSql = "SELECT NombreTipoPeriodo FROM NOM10023"

        Dim cmdBuscar As New SqlCommand
        cmdBuscar.Connection = cnConn
        cmdBuscar.CommandText = strSql
        Dim rdBuscar As SqlDataReader
        cnConn.Open()
        rdBuscar = cmdBuscar.ExecuteReader

        Do While rdBuscar.Read()
            lstPeriodos.Items.Add(rdBuscar("NombreTipoPeriodo").ToString.Trim)
        Loop
    End Sub

    Private Sub frmNominasCalculo_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        ToolStrip1.Cursor = Cursors.Hand
        ToolStrip1.RenderMode = System.Windows.Forms.ToolStripRenderMode.System

        Periodos()

    End Sub
End Class